using Fusion.Hotfix.Mono;
using Fusion.Frameworks.UI;
using Google.Protobuf;
using ILRuntime.Runtime.Enviorment;
using UnityEditor;
using Fusion.Utilities.IO;
using Fusion.Frameworks.Notification;

public class Generator
{
    [MenuItem("DLLManager/GenerateBuildInAdapters", false, 0)]
    public static void GenerateBuildInAdapters()
    {
        string buildInAdapterPath = "Assets/com.fusion.hotfix/Runtime/Scripts/Adapters";
        IOUtility.Write($"{buildInAdapterPath}/UIObjectAdapter.cs", CrossBindingCodeGenerator.GenerateCrossBindingAdapterCode(typeof(UIObject), "Fusion.Hotfix.Adapters"));
        IOUtility.Write($"{buildInAdapterPath}/UIDataAdapter.cs", CrossBindingCodeGenerator.GenerateCrossBindingAdapterCode(typeof(UIData), "Fusion.Hotfix.Adapters"));
        IOUtility.Write($"{buildInAdapterPath}/DLLMonoBaseAdapter.cs", CrossBindingCodeGenerator.GenerateCrossBindingAdapterCode(typeof(DLLMonoBase), "Fusion.Hotfix.Adapters"));
        IOUtility.Write($"{buildInAdapterPath}/DLLMonoDataAdapter.cs", CrossBindingCodeGenerator.GenerateCrossBindingAdapterCode(typeof(DLLMonoData), "Fusion.Hotfix.Adapters"));
        IOUtility.Write($"{buildInAdapterPath}/IMessageAdapter.cs", CrossBindingCodeGenerator.GenerateCrossBindingAdapterCode(typeof(IMessage), "Fusion.Hotfix.Adapters")); 
        IOUtility.Write($"{buildInAdapterPath}/INotificationDataAdapter.cs", CrossBindingCodeGenerator.GenerateCrossBindingAdapterCode(typeof(INotificationData), "Fusion.Hotfix.Adapters")); 
        AssetDatabase.Refresh();
    }
}
